package com.wisezone.permission.service;

import java.io.Serializable;
import java.util.Collection;
import java.util.List;
import java.util.Map;

import com.wisezone.common.exception.WzServiceException;
import com.wisezone.common.exception.WzWebException;
import com.wisezone.common.service.BaseService;
import com.wisezone.permission.bean.entity.WzRoleEntity;

/**
 * 
 *角色; InnoDB free: 24576 kB
 * 
 * @author create by create date 2010-07-29 14:44:46 update date 2010-07-29
 *         14:44:46
 * 
 */
public interface WzRoleService extends BaseService {

	/**
	 * 获得角色id和名称的map
	 * 
	 * @param id
	 * @return
	 */
	public Map<String, String> getMapByRoleId(Long id)
			throws WzServiceException;

	/**
	 * 获得激活的角色列表
	 * 
	 * @return
	 * @throws WzWebException
	 */
	public List<WzRoleEntity> listActive() throws WzWebException;
	
	/**
	 * 获得角色列表
	 * @param userId
	 * @return
	 * @throws WzServiceException
	 */
	public List<WzRoleEntity> listRoleByUserId(Long userId) throws WzServiceException;

	/**
	 * 保存或修改角色
	 * 
	 * @param entity
	 * @param resIds
	 * @throws WzServiceException
	 */
	public void saveOrUpdate(WzRoleEntity entity, String resIds)
			throws WzServiceException;

	/**
	 * 角色删除
	 * 
	 * @param idList
	 * @throws WzServiceException
	 */
	public void delete(Collection<Serializable> idList)
			throws WzServiceException;

}